from celery import Celery
from django.conf import settings
import os

# 项目环境添加值
os.environ.setdefault('DJANGO_SETTINGS_MODULE','PetNetadmin.settings')

# 初始化celery
app = Celery('PetNetadmin')
app.conf.update(
    broker_url = 'redis://:123456@127.0.0.1:6379/1'
)
app.autodiscover_tasks(settings.INSTALLED_APPS)

# 启动命令
# celery -A PetNetadmin worker -l info